package com.example.cloudproviderorder80.service;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
class HystrixClientFallbackFactory implements FallbackFactory<PaymentFeignService> {
    private final HystrixClientFallback hystrixClientFallback = new HystrixClientFallback();

    @Override
    public PaymentFeignService create(Throwable cause) {
        log.error("发生回退", cause);
        return hystrixClientFallback;
    }
}